package com.jpress.conversor;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

import com.jpress.model.Blog;
import com.jpress.dao.DAOBlog;

@FacesConverter("objectConverter")
public class ObjectConverter implements Converter{

	@Override
    public Blog getAsObject(FacesContext ctx, UIComponent component, String value) {
           DAOBlog daoBlog = new DAOBlog();
           return (Blog) daoBlog.findByNome(value.toString());
    }	
	

	public String getAsString(FacesContext ctx, UIComponent component, Object value) {
		return null;
	}
}
